from langchain_core.messages import HumanMessage
from langchain_core.prompts import ChatPromptTemplate

prompt_template = ChatPromptTemplate.from_messages(  # <-- 这是更改的部分
    [("system", "You are a helpful assistant"), ("placeholder", "{msgs}")])

response = prompt_template.invoke({"msgs": [HumanMessage(content="hi!")]})
print(response)
